package com.cmdi.exception;

import com.cmdi.domain.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;

/**
 * @Description: CmdiAdmin的全局异常处理
 * @Author: gaozb
 * @Version: 1.0
 */
@RestControllerAdvice
public class CmdiAdminGlobalExceptionHandler {

    /**
     * 1 CustomCmdiAdminException
     */
    @ExceptionHandler(CustomCmdiAdminException.class)
    public R handlerCustomFeignErrorException(CustomCmdiAdminException customCmdiAdminException){
        return R.fail(customCmdiAdminException.getMessage());
    }
    /**
     * 2 SizeLimitExceededException
     */
//    @ExceptionHandler(MaxUploadSizeExceededException.class)
//    public R handlerSizeLimitExceededException(MaxUploadSizeExceededException maxUploadSizeExceededException){
//        return R.fail(maxUploadSizeExceededException.getMessage());
//    }

}